<?php

class Mtop_category extends CI_Model{
    
    private $tableName = 'category';
    private $parent_cache_key = 'category_parent';
    
   public function __construct(){
        parent::__construct();
        $this->load->database();
    }
    
    
        public function listAll(){


        //$this->db->trans_start();
        $query=$this->db->query('call spo_select_category()');

        //$query=$this->db->get('category');

       //$this->db->trans_complete();
      
        return $query->result_array();
    }
    public function listCateSub($p_cateid,$p_catename){

        $this->db->reconnect();
        $query=$this->db->query('call spo_select_sub_category('.$p_cateid.')');
        $query = $query->result_array();

        $arrData['cate_name'] = $p_catename;
        $arrData['subcate_details'] = $query;

        $arrBlock['result'] = $arrData;


        return $arrBlock;
    }
}